package com.bootdo.screen.controller;


import com.bootdo.screen.service.impl.PtDataServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

import static org.springframework.web.bind.annotation.RequestMethod.GET;

@CrossOrigin
@Controller
@RequestMapping(path = "ptscreen")
public class PtDataController {

    @Autowired
    private PtDataServiceImpl ptDataService;

    // 平台负载
    @ResponseBody
    @RequestMapping(path = "getClusterLoad", method = GET)
    public List<Map<String,Object>> getClusterLoad()  {return ptDataService.getClusterLoad();}

    //平台组件监测
    @ResponseBody
    @RequestMapping(path = "getClusterServerStatus", method = GET)
    public Map<String,Object> getClusterServerStatus() { return ptDataService.getClusterServerStatus();}

    // 故障检测
    @ResponseBody
    @RequestMapping(path = "getClusterFaultMonitor", method = GET)
    public   List<Map<String,Object>>  getClusterFaultMonitor(){ return ptDataService.getClusterFaultMonitor();}

    //资源使用检测 磁盘读写 / 正常节点数 / 平台连接数
    @ResponseBody
    @RequestMapping(path = "getClusterResourceUsed", method = GET)
    public   List<Map<String,Object>>  getClusterResourceUsed(){ return  ptDataService.getClusterResourceUsed();}

    //网络监控 网络流量
    @ResponseBody
    @RequestMapping(path = "getClusterNetWorkStatus", method = GET)
    public   List<Map<String,Object>>  getClusterNetWorkStatus(){ return ptDataService.getClusterNetWorkStatus();}

    //服务列表和区域映射
    @ResponseBody
    @RequestMapping(path = "getClusterServiceList", method = GET)
    public  List<Map<String,Object>> getClusterServiceList() { return  ptDataService.getClusterServiceList();}
}
